*Post-LAPS R&R Do file


*SUMMARY OF DO FILE
*1. Explore coup support around other military contestations
*2. Look at e series items and determine which has the highest predictive power (e2, 3, 14, 15)
*3. Look at correlations between acr1 and other data sets 
*4. Look at other individual predictors as suggested by reviewers: political interest, ethnic minority, l/r scale 
*5. Re-run current regression model using e3 and e3+e15 as DVs; do normative preferences still matter?
*6. Transform the economic variable into a log to try to understand the effect size
*7. Test pn4 (democratic output) as a replacement for ing4
*8. Test protests as a possible DV
*9. Test whether normative preferences for democracy matter in other surveys-WVS


*Data:
use "JCTEST.dta", clear
*Note: The dataset has been renamed CoupReplicationFile.dta

svyset upm [pw= weight1500], strata(strata)

save "JCTEST.dta", replace


****************************************************************
*******1-Explore coup support around other military contestations


*NOTE: See the data visualization do file for replication of Figures 1 and 2 (Honduras and Ecuador)

*Venezuela--Alleged coup 2008, 2014
graph twoway scatter jc_dummy wave if pais==16, xlab(2008 2010 2012 2014, valuelabel angle(30)) ///
 mlabel(jc_dummy) mlabp(11) msymbol(d) mcolor(navy) xtitle("Year") ///
ytitle("Average Coup Justification", size (med)) connect(direct) lwidth(vthin) lcolor(navy) ///
ylabel(30(5)75) caption("AmericasBarometer Fieldwork: 12/10/2007-1/26/2008 and 3/24-4/25/2014") title("Venezuela")

*Bolivia--plotted coup
graph twoway scatter jc_dummy wave if pais==10, xlab(2004 2006 2008 2010 2012 2014, valuelabel angle(30)) ///
 mlabel(jc_dummy) mlabp(11) msymbol(d) mcolor(navy) xtitle("Year") ///
ytitle("Average Coup Justification", size (med)) connect(direct) lwidth(vthin) lcolor(navy) ///
ylabel(30(5)75) caption("AmericasBarometer Fieldwork: Feb.-Mar. 2008") title("Bolivia")

*Manually adjust x axis label line gap, add note for pre-americasbarometer data

****************************************************************
*******2-Look at e series items and determine which has the highest predictive power (e2, 3, 14, 15)

*Full model without e series for comparison (R2 .0531)
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)


**E2--STOPPED BEING ASKED IN 2010

**E3--highly significant
*bivariate model (R2 .0159; t stat 7.56, mag 1.96)
reg jc_dummy e3 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*full model (R2 .0573; t stat 7.77)
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new e3 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

***

**E14--not significant
*bivariate model (R2 .0072; t stat .91, mag .26)
reg jc_dummy e14 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*full model (R2 .0509; t stat -.83)
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new e14 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

***

**E15--significant at p<.1
*bivariate model (R2 .0089; t stat 2.49, mag .56)
reg jc_dummy e15 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*full model (R2 .0536; t stat 1.95)
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new e15 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

***

**E3 + E15: does this add anything to the model? Not really, slightly less than e3 alone
gen e3e15 = (e3 + e15)/2

*bivariate model (R2 .0127; t stat 5.26, mag 1.62)
reg jc_dummy e3e15 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*full model (R2 .0554; t stat 4.5)
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new e3e15 i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

***

*rescale e3 to be on a 0-1 scale where higher values indicate more support for radical groups
gen e3_new = e3-1
replace e3_new = e3_new/9


gen e15_new = e15-1
replace e15_new = e15_new/9


*generate an index of radical attitudes: E3 and E15
gen radatt = (e15_new + e3_new)/2

****************************************************************
*******3-Correlations between acr1 and other data sets 
*please email the authors (kaitlen.j.cassell@vanderbilt.edu) for access
*to older datasets pre-AmericasBarometer, which are used below

***recoding for acr1:
gen acr1_new = acr1
recode acr1_new (1 3 = 0) (2 = 100)
tab acr1_new

**AB 2004, 2006 in Colombia only

*correlations
corr jc_dummy acr1_new e3 if !inlist(pais, 6, 7, 22, 40, 41)

*bivariate regression
reg jc_dummy acr1_new i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*reverse bivariate regression
reg acr1_new jc_dummy  i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*bivariate regression with radical attitudes 
reg radatt jc_dummy  i.year if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)


****

**Bolivia 1998
cd "/Users/Kait/Google Drive/VANDERBILT/Year 2-2015 to 2016/Spring 2016/RA-Seligson/JC Series/Data Analysis /ACR1 tests"
use "Bolivia1998.dta", clear

*recode ACR1
gen acr1_new = acr1
recode acr1_new (1 3 = 0) (2 = 100)
tab acr1_new

*recode bc15
gen bc15_new = bc15
recode bc15_new (1 = 100) (2 = 0)
tab bc15_new

*correlations
corr bc15_new acr1_new e3 

*bivariate regression
reg bc15_new acr1_new 

*reverse bivariate regression
reg acr1_new  bc15_new 

****

**Ecuador 2001
cd "/Users/Kait/Google Drive/VANDERBILT/Year 2-2015 to 2016/Spring 2016/RA-Seligson/JC Series/Data Analysis /ACR1 tests"
use "Ecuador2001.dta", clear

*recode ACR1
gen acr1_new = ACR1
recode acr1_new (1 3 = 0) (2 = 100)
tab acr1_new

*recode jc measures and combine into 1
gen jc10_new = JC10
recode jc10_new (1 = 100) (2 = 0)
tab jc10_new

gen jc13_new = JC13
recode jc13_new (1 = 100) (2 = 0)
tab jc13_new

gen jc_dummy = (jc10_new + jc13_new )
recode jc_dummy (200=100)
tab jc_dummy

*correlations
corr jc_dummy acr1_new E3 

*bivariate regression
reg jc_dummy acr1_new 

*reverse bivariate regression
reg acr1_new  jc_dummy

****

**El Salvador 1999
cd "/Users/Kait/Google Drive/VANDERBILT/Year 2-2015 to 2016/Spring 2016/RA-Seligson/JC Series/Data Analysis /ACR1 tests"
use "el_salvador1999.dta", clear

*recode ACR1
gen acr1_new = acr1
recode acr1_new (1 3 = 0) (2 = 100)
tab acr1_new

*recode jc measures and combine into 1
gen jc10_new = jc10
recode jc10_new (1 = 100) (2 = 0)
tab jc10_new

*correlations
corr jc10_new acr1_new e3 

*bivariate regression
reg jc10_new acr1_new 

*reverse bivariate regression
reg  acr1_new jc10_new

****

**El Salvador 1995
use "ElSalvador1995.dta", clear

*recode ACR1
gen acr1_new = acr1
recode acr1_new (1 3 = 0) (2 = 100)
tab acr1_new

*recode bc
gen bc15_new = bc15
recode bc15_new (1 = 100) (2 = 0)
tab bc15_new

*correlations
corr bc15_new acr1_new e3 

*bivariate regression
reg bc15_new acr1_new 

*reverse bivariate regression
reg  acr1_new bc15_new

****

**Nicaragua 1991
use "nicaragua_1991.dta", clear

*recode ACR1
gen acr1_new = acr1
recode acr1_new (1 3 = 0) (2 = 100)
tab acr1_new

*recode bc
gen bc15_new = bc15
recode bc15_new (1 = 100) (2 = 0)
tab bc15_new

*correlations
corr bc15_new acr1_new e3 

*bivariate regression
reg bc15_new acr1_new 

*reverse bivariate regression
reg acr1_new  bc15_new 

****

**Central America 1991
use "CenAm1991.dta", clear

*recode ACR1
gen acr1_new = ACR1
recode acr1_new (1 3 = 0) (2 = 100)
tab acr1_new

*recode bc
gen bc15_new = BC15
recode bc15_new (1 = 100) (2 = 0)
tab bc15_new

*correlations
corr bc15_new acr1_new E3 

*bivariate regression
reg bc15_new acr1_new, cluster(pais)

*bivariate regression
reg acr1_new bc15_new, cluster(pais)

****************************************************************
*******4- Look at other individual predictors as suggested by reviewers: political interest, ethnic minority, l/r scale 

cd "/Users/Kait/Google Drive/VANDERBILT/Year 2-2015 to 2016/Spring 2016/RA-Seligson/JC Series/Data Analysis "  
use "JCTEST.dta", clear


*1. Political interest (asked 2006-2014)

*broken down by category (can't compare magnitudes)
svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new i.pol1 i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)

*recode political interest to range from 0-1 and to be positive to negative (higher values = more interest)
gen pol1_new = pol1
recode pol1_new (4=0) (3=1) (1=3) (2=2)
replace pol1_new = pol1_new/3

*not broken down
svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new pol1_new i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)

*We can conclude that those with higher political interest are less supportive of coups, but the effect size is 
*not comparatively strong. When we look at a categorical break down, we see that, compared to those with "a lot" 
*of political interest, all categories are statistically significant and increasingly positive

****************************************
*2. Race (etid)--make a note about effect sizes

*recode into the major categories: collapse all minority categories
gen etid_new = etid
recode etid_new (1106/2909 = 7)
label define etid_new 1 "White" 2 "Mestizo" 3 "Indigenous" 4 "Black" 5 "Mullatto" 7 "Other"
label values etid_new etid_new

*run regression with each racial category
svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new i.etid_new i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)

*check out the indigenous finding by country--is it being driven by Venezuela and Bolivia?
bysort pais:  reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new i.etid_new i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)
*country-by-country analysis shows very few significant findings 
*Jamaica shows all races are significantly less likely to support coups
*Positive finding for blacks in Colombia, Honduras but negative black finding in Guatemala 
*Positive finding for mullattos in Nicaragua
*significant indigenous finding in: Uruguay (neg)
*insigificant indigenous finding in: Peru, Bolivia weakly positive (not stat sig)
*significant mestizo finding (negative) in Ecuador, El Salvador


*Try year by year with the full data set
bysort wave:  reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new i.etid_new if !inlist(pais, 6, 7, 22, 40, 41)
*2004: no significant racial finding
*2006: Indigenous and Mestizo is a positive finding
*2008: No significant finding
*2010: All groups are positive except mullatto (significant and negative)
*2012: All groups are positive
*2014: Indigneous is negative, black is positive 

*Doesn't seem to be an issue of descriptive representation or any specific pattern over time. 
*While we can conclude that racial identity does have an effect on coup justification, we
*think that the comparatively small magnitude and lack of systematic patterns suggests
*that race is not driving people's attitudes towards coups; our model findings are consistent
*regardless of the inclusion of race. Further research is needed to further investigate these mechanisms.
****************************************
*3. L/R scale (l1)
*originally coded variable
svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new l1 i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)

*rescale l1 so that it is 0-1
gen l1_res = l1
replace l1_res = l1_res-1
replace l1_res = l1_res/9
tab l1_res

*recode variable into left, center, right
gen l1_new = l1
recode l1_new (1 2 3 4 = 0) (5 6 = 1) (7 8 9 10 = 2)
label define l1_new 0 "Left" 1 "Center" 2 "Right" 
label values l1_new l1_new

*recode variable into extreme left, left, center, right, extreme right
gen l1_alt = l1
recode l1_alt (1 2 = 0) (3 4 = 1) (5 6 = 2) (7 8 = 3) (9 10 = 4)
label define l1_alt 0 "Far Left" 1 "Left" 2 "Center" 3 "Right" 4 "Far Right"
label values l1_alt l1_alt

*run regressions

svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new l1_res i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)

svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new i.l1_new i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)


svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new m1_new b12_new i.l1_alt i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41)


*First, note that our sample size is reduced by 25,000 cases: cite LAV that shows people have a hard time 
*understanding the meaning of this scale in LA. Generally, we see in the data that the more
*left an individual leans, the less likely they are to support coups. This is true regardless
*of which coding scheme is used: 3 or 5 category, but the findings are not always statistically significant 
*particularly with respect to the differences between far leftists and left of center identifiers.
*This overall finding is not surprising given the "Pink Tide" that strongly overlaps with the period of our data. 
*We can see that the magnitude is not inconsequential, but it still falls far behind our main predictors. 

****************************************************************
*******5-Re-run current regression model using e3 and e3+e15 as DVs; do normative preferences still matter?

*Article model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*Replace jc
reg e3_100 q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)
outreg2 using test, dec(2) 

*overall we see very consistent findings: support for the military is strongest, followed by norms
*of democracy and system support 

****************************************************************
*******6-Transform the economic variable into a log to try to understand the effect size

*create a log transformation
gen gdppcppp_add_log = log(gdppcppp_add)

gen gdppcppp_add_lag_log = log(gdppcppp_add_lag)

*Run the two step model
svy: reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new  b12_new m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) 

*Step 2: Then you will run the margins command:
 
*note: 1 # symbol
margins wave#pais, saving(intercepts.dta, replace)
 
*open this dataset and confirm that _m1 is wave & _m2 is pais (should be the order in the margins command)
clear all
use "intercepts.dta"

*adjust rename commands accordingly (only need this step if using merge in Step 3)
rename _m1 wave
rename _m2 pais
save "intercepts.dta", replace
 *This gives you a dataset that is the equivalent of the intercepts. 
 
*reopen the original LAPOP dataset
clear all
use "JCTEST.dta", clear
 
*Step 3: You want to add any level 2 data. If the level2 data is already in your dataset,
*you can collapse and merge that data into the margins dataset:
sort pais wave
collapse gdppcusd gdppcusd_lag gdppcppp_add gdppcppp_add_lag gdppcppp gdppcgrowth gnipcppp gni_ppp militarygdp ///
age_dem inflat_consum inflat_consum_lag inflat_gdpdef mil_dynamic mil_static gdppcppp_add_log gdppcppp_add_lag_log, by(pais wave)
save "lev2.dta", replace
merge 1:1 pais wave using intercepts.dta
 
*Now you have a dataset with all the intercepts and the level2 data. 
 
*Drop missing values for the years/countries in which question was not asked
drop if _merge!=3
drop _merge
 
*Step 4: Now you can run the model the intercepts as outcomes:
 
*regular regression
reg _margin gdppcppp_add  age_dem, vce(hc3)

*run with logged transformation
reg _margin gdppcppp_add_log  age_dem, vce(hc3) 

*run with logged LAGGED transformation
reg _margin gdppcppp_add_lag_log  age_dem, vce(hc3) 


outreg2 using Level2Revised_lag, excel dec(2)

****************************************************************
*******7-Test pn4 (democratic output) as a replacement for ing4

*Article model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*Article model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  pn4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*The results are consistent across models, except pn4 has a magnitude of 8 instead of nearly 14 in the model. 
*To us, this suggests that people value democracy beyond its output, consistent with the interpretation of 
*Mainwaring and Perez-Linan

****************************************************************
*******8-Test protests as a possible DV

*Article model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*2004-2008: prot1 

*Recode and rescale prot1; collapse categories for never and almost never into 1
gen prot1_new = prot1 
recode prot1_new (1 = 100) (2 3 = 0)
tab prot1_new

reg prot1_new q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*2010-2014: prot3

*rescale prot3_new (already in data) to range from 0-100
recode prot3_new (1 = 100)

reg prot3_new q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*Overall, the model fit is poor for the 2010-2014 rounds. While normative preferences for democracy remains statistically significant
*and (comparatiely) substantively meaningful, it is actually positive: individuals who normatively value democracy
*are more likely to participate in protests. To us, this indicates that protest and support for coups are viewed
*differently with respect to their role in supporting or bringing down democracy. As such, we think that acr1 and e3
*are better indicators of the validity coup justification as our dependent variable

****************************************************************
*******9-Test whether normative preferences for democracy matter in other surveys-WVS
*WAVE 6: 2010-2014
cd "/Users/Kait/Google Drive/VANDERBILT/Year 2-2015 to 2016/Spring 2016/RA-Seligson/JC Series/Data Analysis "  
use "WV6_Stata_v_2016_01_01.dta", clear

*DV: "would you say it is a very good, fairly good, fairly bad or very bad way of governing this country? V129. Having the army rule"
*IV: V140. How important is it for you to live in a country that is governed democratically? On this scale where 1 means it is 
*�not at all important� and 10 means �absolutely important� what position would you choose?

*Importantly, there is no measure of trust in the military which is the strongest predictor in our model 


*recode the DV: very good and fairly good = 100, very bad and fairly bad = 0
gen v129_new = V129
recode v129_new (-5 -4 -2 -1 = .) (1 2 = 100) (3 4 = 0)
tab v129_new

*recode the IV: code for missingness
gen v140_new = V140
recode v140_new (-5 -2 -1 = .)
tab v140_new

*rescale to assess comparative magnitudes
gen v140_1 = v140_new
replace v140_1 = v140_1-1
replace v140_1 = v140_1/9

*run a simple regression clustered at the country level
reg v129_new v140_1, cluster(V2)

corr v129_new v140_1

*Do find a statistically significant effect and a substantively meaningful effect size. R2 .02
*Note: I don't control for the fact that there are some Latin American cases in here,
*as well as some cases that don't have militaries (presumably)

*Would be interesting to re-run just on the Latin American cases or to dummy out different regions 
gen pais = 0
replace pais = 1 if inlist(V2, 32, 76, 84, 152, 160, 214, 218, 222, 320, 328, 340, 388, 484, 558, 591, 600, 604, 740, 780, 858, 862)

*Surveyed countries in wave 6: Arg, Brazil, Chile, Ecuador, Mexico, Peru, Trinidad & Tobago, Uruguay

*re-run regression 
reg v129_new v140_1 if pais==1, cluster(V2)

reg v129_new v140_1 if pais==0, cluster(V2)

*Latin America is weaker in this case than the rest of the countries, but still negative and stat sig


*******

*WAVE 5: 2005-2009
cd "/Users/Kait/Google Drive/VANDERBILT/Year 2-2015 to 2016/Spring 2016/RA-Seligson/JC Series/Data Analysis "  
use "WV5_Data_stata_v_2015_04_18.dta", clear

*DV:  "would you say it is a very good, fairly good, fairly bad or very bad way of governing this country? V150. Having the army rule"
*IV: V162. How important is it for you to live in a country that is governed democratically? On this scale where 1 means it is 
*�not at all important� and 10 means �absolutely important� what position would you choose?


*recode the DV: very good and fairly good = 100, very bad and fairly bad = 0
gen v150_new = V150
recode v150_new (-5 -4 -2 -1 = .) (1 2 = 100) (3 4 = 0)
tab v150_new

*recode the IV: code for missingness
gen v162_new = V162
recode v162_new (-5 -2 -1 -4= .)
tab v162_new

*rescale to assess comparative magnitudes
gen v162_1 = v162_new
replace v162_1 = v162_1-1
replace v162_1 = v162_1/9
tab v162_1

*run a simple regression clustered at the country level
reg v150_new v162_1, cluster(V2)
corr v150_new v162_1

*Do find a statistically significant effect and a substantively meaningful effect size (slightly weaker than Wave 6). R2 .01

*corresponding country codes: Argentina (32), Brazil (76), Belize (84), Chile (152), Colombia (160), Dominican (214), Ecuador (218),
*El Salvador (222), Guatemala (320), Guyana (328), Honduras (340), Jamaica (388), Mexico (484), Nicaragua (558),
*Panama (591), Paraguay (600), Peru (604), Suriname (740), Trinidad (780), Uruguay (858), venezuela (862)

*SURVEYED COUNTRIES: Arg, Brazil, Chile, Gua, Mex, Peru, Trinidad & Tobago, Uruguay

gen pais = 0
replace pais = 1 if inlist(V2, 32, 76, 84, 152, 160, 214, 218, 222, 320, 328, 340, 388, 484, 558, 591, 600, 604, 740, 780, 858, 862)

*re-run regression with just Latin American/Caribbean countries 
reg v150_new v162_1 if pais==1, cluster(V2)

*vs non Latin American countries 
reg v150_new v162_1 if pais==0, cluster(V2)

*No significant differences--magnitude and R2 are nearly identical, significant in both cases

****************************************************************
*******10-Subgroup analyses

cd "/Users/Kait/Google Drive/VANDERBILT/Year 2-2015 to 2016/Spring 2016/RA-Seligson/JC Series/Data Analysis "  
use "JCTEST.dta", clear

*Article model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)
est store full_model

****

*Gender (females first, then males)
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & q1_new==1, cluster(pais)
est store women

reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & q1_new==0, cluster(pais)
est store men

outreg2 [*] using Gender_subgroup, excel dec(2) replace

*Model results overall hold for both genders but is slightly more powerful for men. We find that support for democracy is stronger 
*among men, as is trust in the military. However, women are particularly more fearful of crime; the magnitude increases from 6.9
*among men to 10.8 among women. System support also matters more to men than women

****

*Urban/rural (I know we use tamano instead but it's easier to see it in a dichotomous sense)--INTERESTING FINDINGS

*Article model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)
outreg2 using UR_subgroup, dec(2) 

*RURAL
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & ur_new==1, cluster(pais)
est store urban


*URBAN
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & ur_new==0, cluster(pais)
est store rural


*Economic quintile becomes significant for both urban and rural. The coefficient for gender is positive and stat sig:
*urban females are significantly more likely to support coups than urban men. This does NOT hold for rural residents. 
*Our argument seems to apply much better to urban residents than rural ones--R2 of .06 to .09
*Perhaps the most interesting finding is that system support is insignificant, but higher than the average sample for urbanites
*The magnitude of democratic values is 1.5 times that for urban that it is for rural
*Trust in the military is also much higher in the urban than rural communities 

****

*EDUCATION

*First, see how well edr fares in the model instead of ed (using categories instead of years of educ)
*ed
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*edr
reg jc_dummy q1_new  q2 edr tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)

*Basically the same effect--not sure it really makes sense to change it at this point

*Full model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)
est store full_model

*No education
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & edr==0, cluster(pais)
est store no_educ

*Primary education
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & edr==1, cluster(pais)
est store primary_educ

*Secondary Education
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & edr==2, cluster(pais)
est store secondary_educ

*Post secondary education 
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & edr==3, cluster(pais)
est store post_secondary

outreg2 [*] using educ_subgroup, excel dec(2) 

*System support is more impactful with higher levels of education, as is democratic norms (democratic norms is not stat sig for those with 
*no education. Interestingly, this applies to support for the military two: it is increasing across education. Presidential approval
*matters most or those with a primary education, but least for those with a secondary education. R2 is significantly higher in 
*the highest education group (.11) compared to .06 for primary schooling, and .08 for all other groups

****

*POLITICAL INTEREST

*Full model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)
est store full_model

*a lot of interest
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & pol1==1, cluster(pais)
est store ALotOfInterest

*Some interest
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & pol1==2, cluster(pais)
est store SomeInterest

*a little interest
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & pol1==3, cluster(pais)
est store LittleInterest

*no interest
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & pol1==4, cluster(pais)
est store NoInterest

outreg2 [*] using PolInterest_subgroup, excel dec(2) 

*NOTE: this covers 2006-2014, not 2004-2014. 
*The finding for gender is extremely interesting: women with a lot of political interest are singificantly more likely to support
*coups. Those with a lot of political interest are more likely to evaluate fear of crime highly. Interestingly, political
*interest doesn't have a large effect on democratic norms or support for the military, but those with a lot of interest
*are significantly more likely to consider the president's approval in coup support.


****

*RICH/POOR (quintall)

*Full model
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41), cluster(pais)
est store full_model

*quintile 1
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & quintall==1, cluster(pais)
est store quintile1

*quintile 2
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & quintall==2, cluster(pais)
est store quintile2

*quintile 3
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & quintall==3, cluster(pais)
est store quintile3

*quintile 4
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & quintall==4, cluster(pais)
est store quintile4

*quintile 5
reg jc_dummy q1_new  q2 ed tamano quintall exc7_new aoj11_new ///
psar_new  ing4_new b12_new  m1_new  i.wave##i.pais if !inlist(pais, 6, 7, 22, 40, 41) & quintall==5, cluster(pais)
est store quintile5


outreg2 [*] using quintile_subgroup, excel dec(2) 

*Same effect wrt system support: the lowest quintile is not stat sig, and it is increasingly impactful; highest quintile
*is also most likely to have strong democratic norms. The higher the quintile, the higher the R2. 
